const Router = require('koa-router')

const petsList = new Router({prefix: '/petlist'})

const {
    create,
    list,
    detail,
    update,
    remove,
    kindsdetail,
    petbreeddetail,
    getPetList,
} = require('../controller/petlist.controller')

const {
    verifyAuth,
    verifyPermission
} = require('../middleware/auth.middleware')


petsList.post('/', verifyAuth, create)
petsList.get('/petkinds', kindsdetail)
petsList.get('/petbreeds', petbreeddetail)
petsList.get('/list/:userId', verifyAuth, getPetList)

petsList.get('/:petId', detail)
petsList.get('/', list)

petsList.patch('/:petId', verifyAuth, verifyPermission, update)
petsList.delete('/:petId', verifyAuth, verifyPermission, remove)

module.exports = petsList
